home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / examples / mrarpfil / part01 / MRARPFile.h < prev    next >
C/C++ Source or Header  |  1990-06-03  |  2KB  |  54 lines

  1.  
  2. /*  MRARPFile.h
  3.  *  Definitions for ARP extended file support.
  4.  *  Author: Mark R. Rinfret
  5.  */
  6. #ifndef MRARPFILE_H
  7. #define MRARPFILE_H
  8.  
  9. #include <libraries/arpbase.h>
  10. #include <libraries/dosextens.h>
  11.  
  12. typedef struct {
  13.     BPTR                fh;             /* AmigaDOS FileHandle pointer */
  14.     struct DefaultTracker *fileTracker;
  15.     char                *buf;           /* read/write buffer */
  16.     LONG                bufSize;        /* allocated size of buffer */
  17.     LONG                bufLength;      /* number of bytes in buffer */
  18.     LONG                bufPos;         /* read/write position */
  19.     LONG                mode;           /* how file was opened */
  20.     LONG                lastError;      /* last error code encountered */
  21.     LONG                lastPosition;   /* position of last access */
  22.     WORD                endOfFile;      /* used by FRead, FGets */
  23.     } ARPFileHandle;
  24.  
  25. /* Function declarations: */
  26.  
  27. /* MRARPFile.c */
  28. #ifndef __PARMS
  29. /* Attempt to accommodate both Lattice and Manx. I believe Lattice uses
  30.  * macro ARGs for conditional ANSI parameters. Manx uses __PARMS.
  31.  */
  32. #ifdef ARGs
  33. # define __PARMS ARGs
  34. #else
  35. # if __STDC__
  36. #   define __PARMS(x) x
  37. # else
  38. #   define __PARMS(x) ()
  39. # endif
  40. #endif ARGs
  41.  
  42. #endif __PARMS
  43.  
  44. char *FGetsARP __PARMS((char *s, LONG length, ARPFileHandle *file));
  45. LONG FPutsARP __PARMS((char *s, ARPFileHandle *file));
  46. LONG ReadARPFile __PARMS((ARPFileHandle *file, char *buffer, LONG length));
  47. LONG CloseARPFile __PARMS((ARPFileHandle *file));
  48. ARPFileHandle   *OpenARPFile __PARMS((char *name, LONG accessMode, LONG bytes));
  49. LONG SeekARPFile __PARMS((ARPFileHandle *file, LONG position, LONG mode));
  50. LONG WriteARPFile __PARMS((ARPFileHandle *file, const char *buffer, LONG length));
  51.  
  52. #endif
  53.  
  54.